# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgname=qtspell
pkgver=1.0.1
pkgrel=1
pkgdesc='Spell checking for Qt text widgets'
arch=('loong64' 'x86_64')
url='https://github.com/manisandro/qtspell'
license=('GPL3')
depends=('enchant' 'iso-codes' 'qt6-base')
makedepends=('cmake' 'ninja' 'qt6-tools')
source=("https://github.com/manisandro/$pkgname/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('03bb9ef504dff352e162b91e9da89fb34d236e01da54799db69388dc9ceea4c2')

prepare() {
  # Fix location of translations
  sed -i 's|share/${QT_VER}/translations)|share/qt/translations)|' $pkgname-$pkgver/CMakeLists.txt
}

build() {
  cmake -S $pkgname-$pkgver -B build -G Ninja -DCMAKE_INSTALL_PREFIX='/usr' -DQT_VER=6
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
